// src/api/debt.js
import request from '@/request';

// 获取所有债务数据
export const getAllDebts = () => request.get('/api/debt/all');

// 根据变量名查询债务数据
export const getDebtByVariable = (variableName) => request.get(`/api/debt/variable/${variableName}`);

// 插入一条债务数据
export const addDebt = (data) => request.post('/api/debt/insert', data);

// 更新一条债务数据
export const updateDebt = (data) => request.put('/api/debt/update', data);

// 根据变量名删除债务数据
export const deleteDebt = (variableName) => request.delete(`/api/debt/variable/${variableName}`);

// 计算汇总
export const calculateSummary = (data) => request.post('/api/debt/calculate', data);